<!-- 
  grid items have no x,y position, just size. Used to come up with wrong size and overlap. https://github.com/gridstack/gridstack.js/issues/1017
  Now, will have element 5 (position first with small x,y), 1,2,4, then 3 (too big to fit)
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="../../../demo/demo.css"/>
  <script src="../../../dist/gridstack-all.js"></script>

  <style type="text/css">
    .upper .grid-stack-item-content {
      background: blue;
    }
  </style>
</head>

<body>
  <br>
  <div class="grid-stack">
    <div class="grid-stack-item upper" gs-w="2" gs-h="2" gs-id="1">
      <div class="grid-stack-item-content">item 1</div>
    </div>
    <div class="grid-stack-item" gs-w="3" gs-h="2" gs-id="2">
      <div class="grid-stack-item-content">item 2</div>
    </div>
    <div class="grid-stack-item" gs-w="9" gs-h="1" gs-id="3">
      <div class="grid-stack-item-content">item 3 too big to fit, so next row</div>
    </div>
    <div class="grid-stack-item" gs-w="3" gs-h="1" gs-id="4">
      <div class="grid-stack-item-content">item 4</div>
    </div>
    <div class="grid-stack-item" gs-x="1" gs-y="1" gs-w="1" gs-h="1" gs-id="5">
      <div class="grid-stack-item-content">item 5 first</div>
    </div>
  </div>

  <script type="text/javascript">
    let options = {
      cellHeight: 80,
      margin: 5,
      float: true
    };
    GridStack.init(options);
  </script>
</body>

</html>